package com.example;

import org.springframework.context.annotation.Bean;

import java.io.FileNotFoundException;
import java.io.IOException;

public class ExceptionStudy {


    public static void main(String[] args) {
        int param = 1;
        int num = getNum(param);
        System.out.println(num);
    }


    public static int getNum(int num) {
        try{
            System.out.println("执行中。。。。");
            int aa = 10/0;
            num = 100;
            return num;
        } catch (Exception e) {
            System.out.println("出现异常啦===》" +e.getCause());
            num = 200;
            return num;
        } finally {
            num = 300;
            System.out.println("finally。。。。");
            return num;
        }
    }

    public void getaa() throws RuntimeException, IOException, FileNotFoundException {

    }

    public void getaa1()  {
        throw new RuntimeException();
    }


    class study{
        private String name;

        private String age;

        @Bean
        public study getStudy() {
            this.name = "123";
            this.age = "123";
            return this;
        }
    }
}
